<template>
  <div>
    <tinymce-editor
      ref="editor"
      v-model="msg"
      :disabled="disabled"
      :language="language"
      :skin="skin"
      @onClick="onClick"
    >
    </tinymce-editor>
    <button @click="clear">清空内容</button>
    <button @click="disabled = true">禁用</button>
    <button @click="disabled = false">启用</button>
  </div>
</template>

<script>
import TinymceEditor from '_c/tinymce-editor/tinymce-editor'
export default {
  components: {
    TinymceEditor
  },
  data () {
    return {
      msg: '欢迎使用 Tinymce 富文本编辑器',
      disabled: false
    }
  },
  methods: {
    // 鼠标单击的事件
    onClick (e, editor) {
      console.log('Element clicked')
      console.log(e)
      console.log(editor)
    },
    // 清空内容
    clear () {
      this.$refs.editor.clear()
    }
  },
  mounted () {
    console.log('加载tinymce-editor测试页面')
  }
}
</script>

<style>
</style>
